{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "from selenium import webdriver\n",
    "driver = webdriver.Chrome()\n",
    "url = 'http://creditcard.gzcb.com.cn/gzcb_web/transactionApply.action'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "driver.get(url)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "driver.find_element_by_xpath('//*[@id=\"idCardNo\"]').clear()\n",
    "driver.find_element_by_xpath('//*[@id=\"idCardNo\"]').send_keys('420381198901020615')\n",
    "driver.find_element_by_xpath('//*[@id=\"dynamicCode\"]').clear()\n",
    "driver.find_element_by_xpath('//*[@id=\"dynamicCode\"]').send_keys('1937')\n",
    "driver.find_element_by_xpath('//*[@id=\"Prightside\"]/div/div[2]/form/div/div[2]/table/tbody/tr[4]/td[2]/input').click()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "录 入 日 期\n",
      "20160118\n",
      "主附卡标志\n",
      "主卡\n",
      "申 请 状 态\n",
      "已成功发卡\n",
      "产 品 描 述\n",
      "银联标准个人金卡\n",
      "发 卡 日 期\n",
      "20160118\n"
     ]
    }
   ],
   "source": [
    "msg = driver.find_element_by_xpath('//*[@id=\"Prightside\"]/div/div[2]/div/div[2]').text\n",
    "print(msg)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
